﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <script src="/js/header.js"></script>
    <link href="/lib/jquery/jquery-ui.min.css" rel="stylesheet" />
    <script src="/lib/jquery/jquery-ui.min.js"></script>
</head>
<body>
    <div class="data-wrap case">
        <div class="data-tool clearfix">
            <div class="pull-left form-inline ">
            </div>
            <div class="pull-right">
                <form class="form-inline" id="formSearch">

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">页面：</label>
                        <input class="form-control" name="pName" type="text" autocomplete="off">
                    </div>

                    <button type="button" class="btn btn-default btn-sm active" id="btnSearch"><span class="glyphicon glyphicon-search"></span> 搜索</button>
                </form>
            </div>
        </div>
        <div class="paging">
        </div>
    </div>
    <script type="text/x-dot-template" id="template">
        <div class="data-body data-scroll">
            <div class="data-view">
                <div class="data-div-view table-responsive">
                    <table class="table table-hover table-striped table-bordered">
                        <thead>
                            <tr>
                                <th class="t_l">页面</th>
                                <th class="wd75">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{? it && it.length>0}}
                            {{ for(var prop in it) { }}
                            <tr>
                                <td class="t_l">{{=it[prop]['name']}}</td>
                                <td class="wd75">
                                    <button type="button" class="btn btn-default btn-xs" data-modal="/view/sysLanguage/edit.html?id={{=it[prop]['id']}}" data-title="编辑 - {{=it[prop]['name']}}页面" data-width="700" data-height="700">
                                        <span class="glyphicon glyphicon-edit"></span> 编辑
                                    </button>
                                </td>
                            </tr>
                            {{ } }}
                            {{??}}
                            <tr class="noRecord">
                                <td colspan="2">暂无记录！</td>
                            </tr>
                            {{?}}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </script>
    <script type="text/javascript">

        $(function () {
            FlashPay.UI.DataAutoHeight();
            FlashPay.UI.DoSearch();

            $("#btnSearch").click(function () {
                window.currentPage = null;
                doSearch();
            });


            FlashPay.Util.Ajax({
                url: '/SysLanguage/GetPageTypes',
                type: 'POST',
                data: null,
                success: function (res) {
                    if (res.success) {
                        var text = doT.template($("#template").text());
                        $(".paging").html("");
                        $(".paging").append(text(res.data));
                    } else {
                        FlashPay.UI.Tip_warning("操作失败！" + res.errorMessage);
                    }
                },
                error: function (json) {
                    FlashPay.UI.Tip_warning("操作失败！请查看网络，请重试。");
                }
            });
        });

        $(document).keyup(function (event) {
            var keycode = event.which;
            if (keycode == 13) {
                FlashPay.UI.DoSearch();
            }
        });


        function Tip_success(word) {
            FlashPay.UI.Tip_success(word);
        }

        function doSearch() {
            //FlashPay.UI.Pager(".paging", { templateId: "permissionPagerTemplate", pageSize: 15, ajax: { url: '/Permission/GetPager' } });
        }


    </script>
</body>
</html>